<template>
	<view class="">
		<view class="tp-bgf tp-pd30 tp-mb2" @click="show(item)" v-for="(item,index) in list" :key="index">
			<view class="tp-fz30">
				{{item.textTitle}}
			</view>
			<view class="tp-mt10">
				{{item.updateTime || ''}}
			</view>
		</view>
		<Notice ref="notice" :noticeInfo="noticeInfo" :isbtn="true"></Notice>
		<!-- <view class="center_combo tp-h88 tp-fz32 tp-fw600">
			{{textTitle}}
		</view>
		<view class="tp-pd30">
			<jyf-parser :html="context" ref="article"></jyf-parser>
		</view> -->
	</view>
</template>

<script>
	import jyfParser from "@/components/jyf-parser/jyf-parser.vue";
	import Notice from '@/components/common/notice.vue'
	export default {
		components: {
			jyfParser,
			Notice
		},
		data() {
			return {
				type: 1, // 1.新手指引 3.购买须知,4.出行攻略5.拼车费用说明6.租车押金规则说明7.关于我们8.用户协议 9.司机规范10.邀请规则
				textTitle: '', // 标题
				context: '', // 内容
				list: [], // 新手指引列表
				noticeInfo: {} // 须知信息
			};
		},
		onLoad(opt) {
			this.type = opt && opt.type
			uni.setNavigationBarTitle({
				title: opt.name
			});
			this.getInfo()
		},
		methods: {
			// 获取数据
			getInfo() {
				this.$http.get(this.$api.orderText, {
					type: this.type,
				}).then(res => {
					if (res.code === 200) {
						this.list = res.data.list
					}
				})
			},
			// 弹框显示
			show(item){
				this.noticeInfo = item
				this.$refs.notice.show()
			}
			// 获取数据
			// getInfo() {
			// 	this.$http.get(this.$api.orderText, {
			// 		type: this.type,
			// 	}).then(res => {
			// 		if (res.code === 200) {
			// 			this.textTitle = res.data.list[0].textTitle
			// 			this.context = res.data.list[0].context
			// 		}
			// 	})
			// }
		}
	}
</script>

<style lang="scss" scoped>

</style>
